$('.datatable-basic').DataTable({
	 "ajax" : {
		"url" : contextpath + "cOrder/balanceReport/list",
		"data" : function(d) {
            var query = $("#query").serializeObject();
            query["size"] = d.length;
            query["page"] = (d.start/d.length);
			return query;
		},
		"dataFilter": function(data){
            var json = jQuery.parseJSON( data );
            json.recordsTotal = json.totalElements;
            json.recordsFiltered = json.totalElements;
            json.data = json.content;
 
            return JSON.stringify( json );
        }
	 },
	 "columns": [
         { "data": "distributorName" },
         { "data": "recommDistributorName" },
         { "data": "createTime" },
         { "data": "customerName" },
         { "data": "projectName" },
         { "data": "payAmount" },
         { "data": "feeAmount" },
         { "data": "amount" },
         { "data": "payee" },
         { "data": "distributorRebate" },
         { "data": "recommDistributorRebate" },
         { "data": "debtRatio" }
     ],
     "drawCallback": function( settings ) {
      }
});

$(function(){
	$("#submit").click(function(){
		$('.datatable-basic').DataTable().draw();
	});

	$('select').select2({
	    minimumResultsForSearch: Infinity
	});	
})
